function Inimigo(source, hp)
{
this.img = new Image();
this.img.src=("Imagens/inimigo1.png");

this.loaded = false;
this.visible = true;

this.hp = hp;

this.points = this.hp*2;

this.shoot = false;

this.timetoshoot = 0;

this.chancetoshoot = Math.random();//20%?

this.img.onload = function()
{
loaded = true; 
console.log("carregamento pela classe BLOCK " + loaded);
};

   this.size_x = 81;
   this.size_y = 75;
   this.position_x = 0;
   this.position_y = 0;
   this.velocity_x = 0;
   this.velocity_y = 5;
   this.velocity_MAX = 15;
   
        
   this.update=function()
   {
   	this.position_x += this.velocity_x;	
   	this.position_y += this.velocity_y;
   	
   	this.timetoshoot++;
   	
   	if(Math.random()<0.02)
   	{
   	 this.shoot = true;
   	}
   	
   	
   }
   
   this.draw=function()
   {
   	if(this.visible)
   	screen.drawImage(this.img, this.position_x, this.position_y);
   };
}